package org.dreamwork.jasmine2.parser;

public class CommentNode extends TextNode {
    public static final int COMMENT_TYPE_XML = 0;
    public static final int COMMENT_TYPE_JSP = 1;

    private int type;

    public CommentNode (String s) {
        this (s, COMMENT_TYPE_XML);
    }

    public CommentNode (String s, int type) {
        super (s);
        this.type = type;
        this.name = type == COMMENT_TYPE_JSP ? JSP_COMMENT_NODE_NAME : HTML_COMMENT_NODE_NAME;
    }

    public String toString () {
        if (type == COMMENT_TYPE_JSP)
            return "<%--" + super.toString () + "--%>";
        return "<!--" + super.toString () + "-->";
    }
}